package com.smart.tv.boundary;

import com.smart.tv.R;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;

public class DuoMenu extends Activity{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.duo_menu);
		Intent intent = getIntent();
		int firstMenu = intent.getIntExtra("first", 0);
		int secondMenu = intent.getIntExtra("second", 0);
		statusMenu	= intent.getIntExtra("statusMenu", 0);
		
		if(firstMenu!=0 && secondMenu!=0){
			ImageView ivFirst 	=  (ImageView) findViewById(R.id.duoIvFirst);
			ImageView ivSecond 	=  (ImageView) findViewById(R.id.duoIvSecond);
			
			ivFirst.setBackgroundResource(firstMenu);
			ivSecond.setBackgroundResource(secondMenu);
			
			ivFirst.setOnClickListener(new OnClickListener() {
				
				public void onClick(View v) {
					firstAction();
				}
			});
			
			ivSecond.setOnClickListener(new OnClickListener() {
				
				public void onClick(View v) {
					secondAction();
				}
			});
			
		}
		
	}
	
	private void firstAction(){
		switch(statusMenu){
			case INFORMATION : {
				break;
			}
		}
	}
	
	private void secondAction(){
		switch(statusMenu){
			case INFORMATION : {
				Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
						Uri.parse("google.navigation:q=an+rungkut+Surabaya"));
				startActivity(intent);
				break;
			}
		}
	}
	
	public static final int INFORMATION = 0;
	
	public static final String FIRST		= "first";
	public static final String SECOND		= "second";
	public static final String STATUS_MENU 	= "statusMenu";
	
	private int statusMenu = 0;
	

}
